package com.xuetang9.t9.xinhuaxia.service.impl;

import com.xuetang9.t9.xinhuaxia.beans.ReceiveAddress;
import com.xuetang9.t9.xinhuaxia.mappers.ReceiveAddressMapper;
import com.xuetang9.t9.xinhuaxia.service.IReceiveAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 陈焱
 * @version 1.0
 * @desc
 * @time 2020/3/6 下午 2:03
 * @copyright liyq
 * @address 成都西部国际金融中心2栋2201
 **/
@Service
public class ReceiveAddressService implements IReceiveAddressService {

    @Autowired
    private ReceiveAddressMapper receiveAddressMapper;

    @Override
    public List<ReceiveAddress> queryByUid(ReceiveAddress receiveAddress) {
        return receiveAddressMapper.select(receiveAddress);
    }

    @Override
    public boolean insertReceiveAdress(ReceiveAddress receiveAddress) {
        return receiveAddressMapper.insertSelective(receiveAddress)>0;
    }

    @Override
    public boolean removeReceiveAddress(ReceiveAddress receiveAddress) {
        return receiveAddressMapper.delete(receiveAddress)>0;
    }

    @Override
    public boolean updateReceiveAddress(ReceiveAddress receiveAddress) {
        return receiveAddressMapper.updateByPrimaryKey(receiveAddress)>0;
    }
}
